//
//  fourth1ViewController.m
//  豆瓣综合网页
//
//  Created by dllo on 16/1/3.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "fourth1ViewController.h"
#import "LTView.h"
#import "fourth2ViewController.h"
@interface fourth1ViewController ()

@end

@implementation fourth1ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction:)];
    self.navigationItem.leftBarButtonItem = item;
    
    LTView *name = [[LTView alloc] initWithFrame:CGRectMake(20, 100, 350, 50)];
    name.myLabel.text = @"用户名";
    name.myTextField.placeholder = @"请输入用户名";
    [self.view addSubview:name];
    LTView *code = [[LTView alloc] initWithFrame:CGRectMake(20, 160, 350, 50)];
    code.myLabel.text = @"密码";
    code.myTextField.placeholder = @"请输入密码";
    [self.view addSubview:code];
    
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    button2.frame = CGRectMake(200, 240, 150, 50);
    button2.backgroundColor = [UIColor orangeColor];
    button2.layer.borderWidth = 1;
    button2.layer.borderColor = [UIColor lightGrayColor].CGColor;
    button2.layer.cornerRadius = 5;
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    button1.frame = CGRectMake(20, 240, 150, 50);
    button1.backgroundColor = [UIColor greenColor];
    button1.layer.borderWidth = 1;
    button1.layer.borderColor = [UIColor lightGrayColor].CGColor;
    button1.layer.cornerRadius = 5;
    [button1 setTitle:@"登录" forState:UIControlStateNormal];
    button1.showsTouchWhenHighlighted = YES;
    [button1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button1 addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];
    [button2 setTitle:@"注册" forState:UIControlStateNormal];
    button2.showsTouchWhenHighlighted = YES;
    [button2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button2 addTarget:self action:@selector(button1Action) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button2];
    
    
    
}

-(void)buttonAction{
    _block(@"注销");
    
 [self dismissViewControllerAnimated:YES completion:^{
     
 }];
}

-(void)button1Action{
    fourth2ViewController *fourth2 = [[fourth2ViewController alloc] init];
    UINavigationController *fourthNav = [[UINavigationController alloc] initWithRootViewController:fourth2];
    [self presentViewController:fourthNav animated:YES completion:^{
        
    }];
}

- (void)itemAction:(UIBarButtonItem *)item {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
